package com.wuyong.chapter6;

import java.util.ArrayList;
import java.util.Random;

public class Main {

    public static void main(String[] args) {
        int n = 1000;
        Random random = new Random();
        BinarySearchTree<Integer> binarySearchTree = new BinarySearchTree<>();

        for (int i = 0; i < n; i++) {
            binarySearchTree.add(random.nextInt(n));
        }
        ArrayList<Integer> arrayList  = new ArrayList<>();
        while (!binarySearchTree.isEmpty())
            arrayList.add(binarySearchTree.removeMin());

        System.out.println("arrayList = [" + arrayList + "]");
    }
}
